// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'
import fileRequest from "@/utils/file";

export function typeList(params) {
  //此处直接使用参数
  return request({
    url: '/type/getTypeList',
    method: 'GET',
    params
  })
}

export function typeAdd(data) {
  return request({
    url: '/type/insertType',
    method: 'POST',
    data: data
  })
}

export function typeDel(pram) {
  const data = {
    id: pram.id,
  }
  return request({
    url: '/type/updateTypeStatus',
    method: 'GET',
    params : data
  })
}

export function exportRoster(data) {
  return fileRequest({
    url: '/excel/modelTypeExcel',
    method: 'POST',
    data: data,
    responseType:'blob'
  })
}
export function deleteByIdId(params) {
  return request({
    url: '/type/deleteById',
    method: 'GET',
    params
  })
}
/**
 * 文件导入
 * @param data
 */
export function doImport(data) {
  return request({
    url: '/import/importType',
    method: 'POST',
    data
  })
}

export function deleteTypeBatchByIds(params) {
  return request({
    url: '/type/deleteTypeBatchByIds',
    method: 'DELETE',
    params,
  });
}

